import React, { Component } from "react";
import { CSSTransition } from 'react-transition-group';
class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            showTexts: true
        };
        this.handleClickBtn = this.handleClickBtn.bind(this);
    }

    handleClickBtn() {
        this.setState({
            showTexts: !this.state.showTexts
        })
    }
    render() {
        return (
            <div>
                <CSSTransition
                    in={this.state.show}
                    timeout={3000}
                >
                    <p>hell world</p>
                </CSSTransition>
                <button onClick={this.handleClickBtn}>点击</button>
            </div>
        )
    }
}

export default App